/**
 * 人才管理接口
 */
import request from '@/utils/request';
/**
 * 人才库列表
 */
export async function getTalentsList(params) {
    return request('/api/recruitment/v1/talent_archive/list', {
        method: 'POST',
        data: params
    });
}

/**
 * 高级库列表
 */
export async function getSeniorTalentsList(params) {
    return request('/api/recruitment/v1/talent_archive/advance/list', {
        method: 'POST',
        data: params
    });
}

/**
 * 人才库黑名单列表
 */
export async function getBlackList(params) {
    return request('/api/recruitment/v1/talent_archive/blacklist/list', {
        method: 'POST',
        data: params
    });
}

/**
 * 人才库-加入黑名单操作
 * @param {*} params
 */
export async function onAddBlackList(params) {
    return request('/api/oa/v1/work/recruitment/talent_archive/blacklist/actions/save_blacklist', {
        method: 'POST',
        data: params
    });
}

/**
 * 人才库黑名单-移出黑名单操作
 * @talentCode {*} talentCode
 */
export async function onRemoveBlackList(params) {
    return request('/api/recruitment/v1/talent_archive/blacklist/actions/remove_blacklist', {
        method: 'DELETE',
        data: params
    });
}

/**
 * 人才库-加入高级库
 * @param {*} params
 */
export async function onAddSenior(params) {
    return request('/api/recruitment/v1/talent_archive/advance_archive/actions/save_advance_archive', {
        method: 'POST',
        data: params
    });
}

/**
 * 人才库-移出高级库
 * @param {*} params
 */
export async function onRemoveSenior(params) {
    return request('/api/recruitment/v1/talent_archive/advance_archive/actions/remove_advance_archive', {
        method: 'POST',
        data: params
    });
}
/**
 *
 * 人才库-获取应聘岗位下拉列表
 */
export async function getApplyJobs() {
    return request('/api/recruitment/v1/recruit/list', {
        method: 'GET'
    });
}

/**
 *
 * 人才库-获取标签下拉列表
 */
export async function getTagList() {
    return request('/api/recruitment/v1/tags/list', {
        method: 'GET'
    });
}

/**
 *
 * 人才库-获取人才应聘状态
 * @param {*} talentCode
 */
export async function getTalentApplyStatus(talentCode) {
    return request(`/api/recruitment/v1/talent_archive/talent_recruit_procedure/${talentCode}`, {
        method: 'GET'
    });
}

/**
 *
 * 人才库-统计各种类型人才数量
 */
export async function getTalentTypeConunts() {
    return request('/api/recruitment/v1/talent_archive/stat_archive', {
        method: 'GET'
    });
}

/**
 *
 * 人才库-统计各种类型人才数量
 */
export async function setRead(talentCode) {
    return request(`/api/recruitment/v1/talent_archive/${talentCode}/actions/read`, {
        method: 'PUT'
    });
}

/**
 * 人才设置-获取高级库入库条件列表
 */
export async function getSeniorConditionList() {
    return request('/api/recruitment/v1/settings/talent_advance_archive/list', {
        method: 'GET'
    });
}

/**
 * 人才设置-添加高级库入库条件
 * @param {*} params
 */
export async function onAddSeniorCondition(params) {
    return request('/api/recruitment/v1/settings/talent_advance_archive/actions/save_talent_advance_condition', {
        method: 'POST',
        data: params
    });
}

/**
 * 人才设置-更新高级库入库条件
 * @param {*} params
 */
export async function onUpdateSeniorCondition(params) {
    return request('/api/recruitment/v1/settings/talent_advance_archive/actions/update_talent_advance_condition', {
        method: 'PUT',
        data: params
    });
}

/**
 * 人才设置-删除高级库入库条件
 * @param conditionId
 */
export async function onDeleteCondition(conditionId) {
    return request(
        `/api/recruitment/v1/settings/talent_advance_archive/actions/delete_talent_advance_condition/${conditionId}`,
        {
            method: 'DELETE'
        }
    );
}

/**
 * 人才设置-高级库是否设置
 */
export async function getTalentsSettingStatus() {
    return request('/api/recruitment/v1/settings/talent_advance_archive/count', {
        method: 'GET'
    });
}
